﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Pyramid.Models
{
	public class SalaryPart
	{
		[Display(Name = "序号")]
		public int Id { get; set; }

		[Display(Name = "名称")]
		[MaxLength(20)]
		[Required]
		public string Name { get; set; }

		[Display(Name = "编码")]
		[MaxLength(10)]
		[Required]
		public string Code { get; set; }

		[Display(Name = "类型")]
		public int SalaryPartType { get; set; }

		[NotMapped]
		public SalaryPartTypes SalaryPartTypeEnum
		{
			get { return (SalaryPartTypes) SalaryPartType; }
		}

		[Display(Name = "变量名称")]
		[MaxLength(20)]
		[Required]
		public string VariableName { get; set; }

		[Display(Name = "显示格式")]
		public string DisplayFormat { get; set; }

		[Display(Name = "计算方式")]
		public int CalculateType { get; set; }

		[NotMapped]
		public CalculateTypes CalculateTypeEnum
		{
			get { return (CalculateTypes) CalculateType; }
		}

		[Display(Name = "备注")]
		[MaxLength(50)]
		public string Remark { get; set; }
	}
}